<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head  >
	<title>
		
	</title>
</head>
<body>



<script type="text/javascript">
	console.log(createTree(0));

	function createTree(num){

		//5级深度
		if(num == 5){
			return null;
		}

		var temp = {
			name: ++num+"级",
			child : createTree(num),
		};

		return temp;

	}
</script>
</body>
</html>